<template>
	<view class="layout">
		<view class="navbar">
			<view class="statusBar" :style="{height:getstatusBarHeight() + 'px'}">
			</view>
			<view class="titleBar" 
			:style="{height:getTitleBarHeight() + 'px', marginLeft:getLeftIconLeft() + 'px'}">
				<view class="title">
					{{title}}
				</view>
				
				<navigator url="/pages/search/search" class="search">
					<uni-icons type="search" size="18" color="#888"></uni-icons>
					<text class="text">搜索</text>
				</navigator>
			</view>
		</view>
		
		<view class="fill" :style="{height:getNavBarHeight() + 'px'}">
			
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue';
import {getstatusBarHeight, getTitleBarHeight, getNavBarHeight, getLeftIconLeft} from '@/utils/system.js'
// console.log(getstatusBarHeight());
// console.log(getTitleBarHeight());
// console.log(getNavBarHeight());

defineProps({
	title:{
		type: String,
		default: '壁纸'
	}
})
</script>

<style scoped lang="scss">
.layout{
	.navbar{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		// box-sizing: border-box;
		z-index: 10;
		background:
		linear-gradient(to bottom, transparent, #fff 400rpx),
		linear-gradient(to right, pink 20%, #f4e2d8);
		
		// .statusBar{border: 1px solid red;}
		.titleBar{
			display: flex;
			// justify-content: space-between;
			align-items: center;
			padding: 0 30rpx;
			// height: 100rpx;
			.title{
				font-size: 50rpx;
				font-weight: 700;
				color: $text-font-color-1;
			}
			.search{
				width: 220rpx;
				height: 56rpx;
				border-radius: 60rpx;
				background-color: rgba(255, 255, 255, 0.4);
				// border: 1rpx solid #fff;
				margin-left: 30rpx;
				color: #999;
				font-size: 28rpx;
				line-height: 56rpx;
				padding-left: 10rpx;
				display: flex;
				align-items: center;
				uni-icons{
					margin-left: 5rpx;
				}
				
				.text{
					padding-left: 10rpx;
				}
			}
		}
	}
	.fill{
		
	}
}
</style>